import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.json.JSONObject;

import com.android.volley.Request.Method;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.RequestQueue;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.Volley;


public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		StringBuffer sb = new StringBuffer();
//		try {
//			FileInputStream fis = new FileInputStream("F:\\android_workspace\\Demojava\\src\\test.txt");
//			InputStreamReader isr = new InputStreamReader(fis, "utf-8");
//			BufferedReader br = new BufferedReader(isr);
//			String line = null;
//			while((line = br.readLine()) != null){
//				sb.append(line + "\r\n");
//			}
//			br.close();
//			isr.close();
//			fis.close();
//			Pattern pattern = Pattern.compile("<[\\S\\s]*?name=\"(.*?)\"[\\S\\s]*?(?:action|value)=\"(.*?)\"[\\S\\s]*?>");
//			Matcher matcher = pattern.matcher(sb.toString());
//			while(matcher.find()){
//				System.out.println("name:" + matcher.group(1));
//				System.out.println("action|value:" + matcher.group(2));
//			}
//			
//		} catch (FileNotFoundException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (UnsupportedEncodingException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		
		FormRequest request = new FormRequest(Method.GET, "https://kyfw.12306.cn/otn/login/init", null, new Listener<JSONObject>() {

			@Override
			public void onResponse(JSONObject response) {
				// TODO Auto-generated method stub
				
			}
		}, new ErrorListener() {

			@Override
			public void onErrorResponse(VolleyError error) {
				// TODO Auto-generated method stub
				
			}
		});
		RequestQueue queue = Volley.newSSLRequestQueue();
//		RequestQueue queue = Volley.newRequestQueue();
		queue.add(request);
		queue.start();
	}

}
